package file;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.Reader;

// 字符流--读
public class Demo2 {
    public static void main(String[] args) throws IOException {
        Reader reader = new FileReader("test.txt");

        char[] buffer = new char[1024];
        int len = reader.read(buffer);

        for (int i = 0; i < len; i++) {
            System.out.println(buffer[i]);
        }
        System.out.println(len);

        reader.close();

    }
}
